package at.ac.tuwien.dse.health.security.testservices;

import at.ac.tuwien.dse.health.security.Secured;
import at.ac.tuwien.dse.health.security.testservices.roles.BackOfficeUser;
import at.ac.tuwien.dse.health.security.testservices.roles.CRMTeamLead;
import at.ac.tuwien.dse.health.security.testservices.roles.CustomerConsultant;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Bernhard Nickel
 * @author Gregor Schauer
 * @author Dominik Strasser
 */
@Service
public class CreditService{
	public List<String> creditApplications=new ArrayList<String>();

	public List<String> verified=new ArrayList<String>();

	public List<String> approved=new ArrayList<String>();

	public List<String> additionalInformationRequests=new ArrayList<String>();

	@Secured
	public void createReport(){
		
	}

	@Secured(CustomerConsultant.class)
	public void submitCreditApplication(String id){
		creditApplications.add(id);
	}

	@Secured(value = BackOfficeUser.class, inherited = false)
	public void verifyCollateralAgreements(String id){
		verified.add(id);
	}

	@Secured(BackOfficeUser.class)
	public void requestInformation(String id){
		additionalInformationRequests.add(id);
	}

	@Secured(CRMTeamLead.class)
	public void approveCreditApplication(String id){
		approved.add(id);
	}

	public List<String> getCreditApplications() {
		return creditApplications;
	}

	public List<String> getVerified() {
		return verified;
	}

	public List<String> getApproved() {
		return approved;
	}

	public List<String> getAdditionalInformationRequests() {
		return additionalInformationRequests;
	}
}
